package com.ylkj.bus.onoffline.report.constant;

import lombok.Getter;

/**
 * @Author: wengzx
 * @Date: 2025/4/24
 * @Desc:
 */
@Getter
public enum EquipmentProxyEnum {
    CONTINUOUS_3D_OFFLINE("continuous_3d_offline", "固定检测", "设备已至少连续3天离线", "前往现场查看离线原因"),
    LAST_OFFLINE("last_offline", "固定检测", "设备当前为离线状态", "前往现场查看离线原因"),

    APP_UNINSTALL("app_uninstall", "固定检测", "设备未安装“{}”APP", "使用运维工具“应用安装”安装缺失的app"),

    APP_INSTALL_NONSTANDARD("app_install_nonstandard", "固定检测", "“{}”APP未安装标准版本", "使用运维工具“应用升级”升级已安装但版本不标准的app"),

    APP_CRASH("app_crash", "固定检测", "“{}”APP被异常停止", "使用运维工具“应用升级”对app停止状态达到修复的效果"),

    CPU_UTILIZATION_RATE_EXCEEDING_THRESHOLD("cpu_overload", "终端上报", "CPU使用率为%s，超过阈值", "通过进程监测具体app的使用情况，请app开发商进行处理"),

    MEMORY_UTILIZATION_RATE_EXCEEDING_THRESHOLD("memory_overload", "终端上报", "内存使用率为%s，超过阈值",
            "通过进程监测具体app的使用情况，请app开发商进行处理"),

    DISK_UTILIZATION_RATE_EXCEEDING_THRESHOLD("disk_overload", "终端上报", "磁盘使用率为%s，超过阈值", "使用运维工具“磁盘清理”清理日志目录"),

    OPEN_THE_TOP_COVER("lid_opened_with_cover", "终端上报", "设备上盖处于开盖状态", "前往现场把盖子关上"),

    END_CAP_OPENING("lid_opened_without_cover", "终端上报", "设备尾盖处于开盖状态", "前往现场把盖子关上"),

    POWER_DOWN("power_loss", "终端上报", "设备处于掉电状态", "前往现场查看掉电原因"),

    TEMPERATURE("temperature", "终端上报", "设备处于高温状态/设备处于低温状态", "前往现场查看掉电原因"),

    ;

    /**
     * 指标名称
     */
    private final String proxyName;

    /**
     * 告警来源
     */
    private final String proxyOrigin;
    /**
     * 告警描述
     */
    private final String proxyDesc;
    /**
     * 消缺意见
     */
    private final String proxySuggest;

    EquipmentProxyEnum(String proxyName, String proxyOrigin, String proxyDesc, String proxySuggest) {
        this.proxyName = proxyName;
        this.proxyOrigin = proxyOrigin;
        this.proxySuggest = proxySuggest;
        this.proxyDesc = proxyDesc;
    }

    public static EquipmentProxyEnum getEquipmentProxyEnum(String proxyName) {
        for (EquipmentProxyEnum value : values()) {
            if (value.getProxyName().equals(proxyName)) {
                return value;
            }

        }
        return null;
    }
}
